<div class='CartWrap'>
   <div class="CartNav clearfix">
     <div class="step stepbj3"><span class="step1"><{t}>购物车<{/t}></span><span class="step2"><{t}>填写订单并确认<{/t}></span><span class="step3"><{t}>成功提交订单<{/t}></span><span class="mycart"><{t}>我的购物车<{/t}></span></div>
    </div>
</div>
<form action="<{link app=b2c ctl='site_paycenter' act='dopayment' arg0='order'}>" method="post" id="f_order_pay">
<{include file="site/common/orderinfo.html"}>
<input type="hidden" name="payment[order_id]" value="<{$order.order_id}>" />
<input type="hidden" name="payment[money]" value="<{$order.total_amount-$order.payed}>" id="hidden_money"/>
<input type="hidden" name="payment[currency]" value="<{$order.currency}>" />
<input type="hidden" name="payment[cur_money]" value="<{$order.cur_money}>" id="hidden_cur_money"/>
<input type="hidden" name="payment[cur_rate]" value="<{$order.cur_rate}>" />
<input type="hidden" name="payment[cur_def]" value="<{$order.cur_def}>" />
<input type="hidden" name="payment[cost_payment]" value="<{$order.payinfo.cost_payment}>" />
<input type="hidden" name="payment[cur_amount]" value="<{$order.cur_amount}>" />
<input type="hidden" name="payment[memo]" value="<{$order.memo}>" />
<!--<input type="hidden" name="payment[return_url]" value="<{$return_url}>" />-->
<{if $order.selecttype}>
  <div class="select-paymethod">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="liststyle data">
      <{foreach from=$payments item=item key=key}>
			<tr>
				<th style="text-align: left;width:20%;">
					<label><input type="radio" onclick="Order.paymentChange(this)" formatmoney="<{$order.cur_def}><{$item.cur_money}>" curmoney="<{$item.cur_money}>" moneyamount="<{$order.total_amount}>"<{if $order.payinfo.pay_app_id == $item.app_id}> checked="checked"<{/if}> value="<{$item.app_id}>" paytype="<{$item.app_id}>" name="payment[pay_app_id]" class="x-payMethod" style="cursor: pointer;"><{$item.app_name}></label> 
				</th>
				<td class="ColColorBlue selected"><{$item.app_des}></td>
			</tr>
		<{/foreach}>
    </table>
  </div>
  <div class="division textcenter" style="margin:10px;">
     <button type="submit" class="btn order-btn btn-has-icon" > <span><span> <{t}>立刻支付<{/t}><i class="btn-icon"> <img src='<{$res_url}>/bundle/order.png'/></i></span></span> </button>
  </div>
<{else}>
  <input type="hidden" name="payment[pay_app_id]" value="<{$order.payinfo.pay_app_id}>" />
  <div style="width:950px; margin:0 auto">
    <table width="100%" border="0" cellspacing="0" style="margin-top:10px" cellpadding="0" class="tableform">
      <col class="span-6 ColColorGray"></col>
      <col class="span-5  ColColorBlue textcenter"></col>
      <tr>
        <td align="left" style="padding:5px 10px;">
          <{if $order.total_amount > $order.payed}>
            <{if $order.payinfo.pay_key=="OFFLINE"}>
             <div class="customMessages"><{t}>您选择了线下支付，请根据支付方式说明进行付款，付款后可通过网站信息联系我们。<{/t}></div></strong>
            <{elseif $order.payinfo.pay_key==-1 || $order.payinfo.pay_key=="PAYAFT"}>
             <div class="customMessages"><{t}>货到付款<{/t}>
            <{else}>
              <{if $order.payinfo.pay_key=="DEPOSIT"}>
               <{t}>您选择了预存款支付<{/t}>
              <{/if}>
             <button type="submit" class="btn order-btn btn-has-icon" > <span><span> 立刻支付<i class="btn-icon"> <img src='<{$res_url}>/bundle/order.png'/></i></span></span> </button>
           <a class="lnk" href="<{link app=b2c ctl="site_order" act="detail" arg0=$order.order_id arg1='true'}>"><{t}>选择其他支付方式&raquo;<{/t}></a> 
            <{/if}>
           <{else}>
            <{t}>订单不需要再支付,请等待我们处理<{/t}>
            <{/if}>
        </td>
        <td align="right" style="padding-right:100px">
         <strong><{t}>共需支付:<{/t}></strong>
          <span class="hueorange fontcolorRed font20px"><{$order.cur_money|cur_odr:$order.currency:false:true}></span>
        </td>
      </tr>
    </table>
  </div>
<{/if}>
</form>

<script>
        void function(){
        var form= $('f_order_pay');
            Order ={
                
                paymentChange:function(target){
                         if(!target)return;
                         target = $(target);
                     var money  = target.get('moneyamount');
					 var cur_money = target.get('curmoney');
                     var fmoney = target.get('formatmoney');
                     var paytype= target.get('paytype');
                     
                     $('hidden_money').set('value',money);
                     $('hidden_cur_money').set('value',cur_money);
                     //$('span_amount').set('text',fmoney);
					 var btn_odr = form.getElement('button[type=submit]');
                     btn_odr.getElement('span span').innerHTML = paytype!='offline'?'<{t}>立刻支付<{t}><i class="btn-icon"> <img src="<{$res_url}>/bundle/order.png" /></i>':'';
                     
                     if (paytype!='offline'){
						btn_odr.set('class', 'btn order-btn btn-has-icon');
					 }else{
						btn_odr.set('class', 'btn-pay-ok');
					 }
                     /* $$('#_normal_payment th .ExtendCon input[type=radio]').fireEvent('checkedchange');*/
                }
            
            };
            
            if($E('#f_order_pay .select-paymethod')){
                Order.paymentChange($E('#f_order_pay .select-paymethod input[checked]'));
                
                if(form&&form.getElement('input[type=submit]')){
                    form.getElement('input[type=submit]').addEvent('click',function(e){
                        
                        if(!$E('#f_order_pay .select-paymethod input[checked]')){
                        MessageBox.error('<{t}>请选择支付方式<{/t}>');
                        return e.stop();
                        }
                    
                    });
                }
            }
        }();
</script>